import java.util.Scanner;

public class Leetcode_5 {
    public static int mySqrt(int x) {
        if (x == 0) {
            return 0;
        }
        int ans = (int) Math.exp(0.5 * Math.log(x));
        return (long) (ans + 1) * (ans + 1) <= x ? ans + 1 : ans;
    }
    public static void main(String[] args) {
        System.out.println("情输入一个数：");
        Scanner S = new Scanner(System.in);
        int a = S.nextInt();//我输入5
        System.out.println("它的算数平方根是：");
        System.out.println(mySqrt(a));
    }
}
